An Introduction to Programming with Threads
نویسنده
چکیده
This paper provides an introduction to writing concurrent programs with " threads ". A threads facility allows you to write programs with multiple simultaneous points of execution, synchronizing through shared memory. The paper describes the basic thread and synchronization primitives, then for each primitive provides a tutorial on how to use it. The tutorial sections provide advice on the best ways to use the primitives, give warnings about what can go wrong and offer hints about how to avoid these pitfalls. The paper is aimed at experienced programmers who want to acquire practical expertise in writing concurrent programs. This work may not be copied or reproduced in whole or in part for any commercial purpose. Permission to copy in whole or in part without payment of fee is granted for non-profit educational and research purposes provided that all such whole or partial copies include the following: a notice that such copying is by permission of acknowledgement of the authors and individual contributors to the work; and all applicable portions of the copyright notice. Copying, reproducing, or republishing for any other purpose shall require a license with payment of fee to the Systems Research Center. All rights reserved.
منابع مشابه
An Introduction to Programming with C# Threads
The attached paper by Andrew Birrell, An Introduction to Programming with C# Threads, originally appeared as An Introduction to Programming with Threads, report 35 of the Systems Research Center, Digital Equipment Corp., Jan. 1989; it was based on the Modula-3 language. A somewhat revised version appears as chapter 4 of Systems Programming with Modula-3, Greg Nelson ed., Prentice-Hall, 1991, pp...
متن کاملAn Introduction to Program and Thread Algebra
We provide an introduction to Program Algebra (PGA, an algebraic approach to the modeling of sequential programming) and to Thread Algebra (TA). PGA is used as a basis for several lowand higher-level programming languages. As an example we consider a simple language with goto’s. Threads in TA model the execution of programs. Threads may be composed with services which model (part of) the execut...
متن کاملParallel Implementation of Particle Swarm Optimization Variants Using Graphics Processing Unit Platform
There are different variants of Particle Swarm Optimization (PSO) algorithm such as Adaptive Particle Swarm Optimization (APSO) and Particle Swarm Optimization with an Aging Leader and Challengers (ALC-PSO). These algorithms improve the performance of PSO in terms of finding the best solution and accelerating the convergence speed. However, these algorithms are computationally intensive. The go...
متن کاملThick Control Flows: Introduction and Prospects
Besides correctness of programing, the technical software problem of many contemporary approaches to multithreaded computations is how to organize the co-operation of a huge number of parallel threads. For the software problems, we propose parallel thick control flows as the solution. When a thick control flow (in terms of the number of threads) is executing a statement or an expression of a pr...
متن کاملBuilding an Open-source Solaris-compatible Threads Library
Applications that use the Solaris threads application programming interface (API), e.g. thr_create(), mutex_lock(), cond_signal(), etc. [1], are generally non-portable. Thus to port an application that uses Solaris threads to another platform will require some degree of work. Solaris now supports the POSIX threads API as well as the Solaris threads API. Therefore to make a Solaris threaded appl...
متن کامل